/*
 * H264RtpPacker.h
 *
 *  Created on: 2018年4月21日
 *      Author: chuanjiang.zh@qq.com
 */

#ifndef H264RTPPACKER_H_
#define H264RTPPACKER_H_

#include "RtpPacker.h"
#include "ByteBuffer.h"

namespace av
{

class H264RtpPacker: public RtpPacker
{
public:
	H264RtpPacker();
	virtual ~H264RtpPacker();

	virtual bool open();

	virtual void pack(const MediaPacket& pkt, int maxSize, RtpPackerSink sink);

	virtual void close();

protected:
	void sliceNaluPtr(uint8_t* data, uint8_t* end, uint32_t timestamp, bool mark, int maxSize, RtpPackerSink sink);
	void sliceNalu(uint8_t* data, int size, uint32_t timestamp, bool mark, int maxSize, RtpPackerSink sink);

protected:
	ByteBuffer   m_buffer;

};


} /* namespace av */

#endif /* H264RTPPACKER_H_ */
